﻿using System.Text.Json.Serialization;

namespace vite_net.Common
{
    public class Result<T> where T : class
    {
        public string? StatusCode { get; set; }

        public string? Message { get; set; }

        public T? Data { get; set; }


        public static Result<T> Ok(T data)
        {
            Result<T> result = new Result<T>();
            result.StatusCode = "00000"; // 5个0
            result.Data = data;
            return result;
        }

        public static Result<T> Fail(string msg)
        {
            Result<T> result = new Result<T>();
            result.StatusCode = "00001"; // 5个0
            result.Message = msg;
            return result;
        }
    }
}
